---
layout: example
categories: example/v1.0.0
version: v1.0.0
title: Display marker tooltip on load
description: Control whether a marker tooltip should be displayed on load
tags: [ui, markers]
---

<div id='map'></div>
<script>
var map = L.mapbox.map('map')
    .setView([40.7271, -73.9840], 14)
    .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

// Build a marker from a simple GeoJSON object:
var marker = L.mapbox.featureLayer({
    type: 'Feature',
    geometry: {
        type: 'Point',
        coordinates: [-73.9840, 40.7271]
    },
    properties: {
        title: 'Hello world!',
        'marker-color': '#f86767'
    }
}).addTo(map);

// Iterate over the featureLayer we've called "marker"
// and open its popup instead of clicking to trigger it.
marker.eachLayer(function(m) {
  m.openPopup();
});
</script>
